<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
    <f:view locale="#{i18N.locale}">
    <h:form>
    	<p:dataTable value="#{relatorioBean.listProtocol}" var="protocol" emptyMessage="#{msgs.semdados}"
							rowKey="#{protocol.codigo}"
							selection="#{relatorioBean.protocol}" selectionMode="single">
							<p:ajax event="rowSelect" listener="#{relatorioBean.setProtocol}" />
							
							<p:column>
								<h:outputText value="#{protocol.identification.title}"/>
							</p:column>
    	
    	</p:dataTable>
    	<h:inputHidden value="#{relatorioBean.protocol}"/>
        </h:form>																											
    	<h:form id="r" target="_blank">
            <p:commandButton value="Ver relatorio" action="#{relatorioBean.gerarRelatorio}"  process="r" ajax="false"/>
        </h:form>
        </f:view>
    </h:body>
</html>